
package com.starshineworks.entities;

import com.db4o.ObjectContainer;
import com.db4o.ObjectSet;
import com.starshineworks.util.DbUtil;
import java.util.Map;
import java.util.HashMap;

public class UserinfoE extends EntityE {
    
    public String   _firstname;
    public String   _lastname;
    public Integer  _userId;
    public String   _permission;
    public String   _homephone;
    public String   _cellphone;
    public String   _workphone;
    public AddressE _address;
    public Integer  _complete; // XXX should be boolean

    public UserinfoE() {
    }
    
    public UserinfoE(Integer id) {
        this._id = id;
    }

    public static UserinfoE retrieveByUser(Integer uId) {
        return retrieveByUser(new UserE(uId));
    }
    
    public static UserinfoE retrieveByUser(UserE proto) {
        UserinfoE ui = null;
        UserE u = ((UserE)EntityE.retrieve(proto).get(0));
        if (u != null) {
            ui = u._info;
        }
        return ui;
    }
  
    public String[] fullName() {
        String[] s = new String[2];
        s[0] = _firstname;
        s[1] = _lastname;
        return s;
    }

}


